// 口腔检查表配置文件
export const oralConfig = {
    // 问卷基本信息
    title: '口腔检查表',
    subtitle: 'Oral Examination Form',
    description: '全面的口腔健康状况评估',
    instruction: '请根据实际检查情况填写以下各项内容，确保记录准确完整。',
    version: '1.0',

    // 表单分组配置
    sections: {
        basicInfo: {
            title: '被检查人基本信息',
            fields: [
                {
                    name: 'patientName',
                    label: '姓名',
                    type: 'text',
                    required: false,
                    placeholder: '请输入被检查人姓名（可选）'
                },
                {
                    name: 'age',
                    label: '年龄',
                    type: 'number',
                    required: false,
                    placeholder: '请输入年龄（可选）',
                    min: 0,
                    max: 150
                },
                {
                    name: 'gender',
                    label: '性别',
                    type: 'radio',
                    required: false,
                    options: [
                        { value: 'male', label: '男性' },
                        { value: 'female', label: '女性' }
                    ]
                },
                {
                    name: 'patientId',
                    label: '病历号/身份证号',
                    type: 'text',
                    required: false,
                    placeholder: '请输入病历号或身份证号（可选）'
                },
                {
                    name: 'birthplace',
                    label: '籍贯',
                    type: 'text',
                    required: false,
                    placeholder: '请输入籍贯（可选）'
                },
                {
                    name: 'phone',
                    label: '联系电话',
                    type: 'tel',
                    required: false,
                    placeholder: '请输入联系电话（可选）'
                },
                {
                    name: 'examDate',
                    label: '检查日期',
                    type: 'datetime-local',
                    required: false
                },
                {
                    name: 'remarks',
                    label: '备注',
                    type: 'textarea',
                    required: false,
                    placeholder: '请输入本次检查的备注信息（可选）',
                    rows: 3
                }
            ]
        },
        examination: {
            title: '口腔检查项目',
            description: '请根据实际检查情况详细记录各项检查结果'
        }
    },

    // 检查项目分组
    examGroups: [
        {
            id: 'teeth_condition',
            title: '牙齿状况',
            description: '检查牙齿的整体状况，包括龋齿、缺损、缺失等',
            questions: [
                {
                    id: 'caries_check',
                    type: 'composite',
                    label: '龋齿检查',
                    description: '检查各牙位的龋坏情况',
                    required: true,
                    subQuestions: [
                        {
                            id: 'caries_present',
                            field: 'caries_present',
                            text: '是否发现龋齿',
                            type: 'radio',
                            options: [
                                { value: 'no', label: '无龋齿' },
                                { value: 'yes', label: '有龋齿' }
                            ]
                        },
                        {
                            id: 'caries_details',
                            field: 'caries_details',
                            text: '龋齿详细情况',
                            type: 'textarea',
                            placeholder: '请详细记录患牙牙位及龋坏程度（如：上颌右侧第一磨牙深龋、下颌左侧侧切牙浅龋等）',
                            dependsOn: 'caries_present',
                            showWhen: ['yes'],
                            rows: 4
                        },
                        {
                            id: 'caries_severity',
                            field: 'caries_severity',
                            text: '龋坏程度',
                            type: 'checkbox',
                            dependsOn: 'caries_present',
                            showWhen: ['yes'],
                            options: [
                                { value: 'shallow', label: '浅龋' },
                                { value: 'medium', label: '中龋' },
                                { value: 'deep', label: '深龋' },
                                { value: 'pulpitis', label: '牙髓炎' },
                                { value: 'periapical', label: '根尖周炎' }
                            ]
                        }
                    ]
                },
                {
                    id: 'tooth_defect_check',
                    type: 'composite',
                    label: '牙齿缺损检查',
                    description: '检查牙齿缺损情况',
                    required: true,
                    subQuestions: [
                        {
                            id: 'defect_present',
                            field: 'defect_present',
                            text: '是否有牙齿缺损',
                            type: 'radio',
                            options: [
                                { value: 'no', label: '无缺损' },
                                { value: 'yes', label: '有缺损' }
                            ]
                        },
                        {
                            id: 'defect_cause',
                            field: 'defect_cause',
                            text: '缺损原因',
                            type: 'checkbox',
                            dependsOn: 'defect_present',
                            showWhen: ['yes'],
                            options: [
                                { value: 'caries', label: '龋齿' },
                                { value: 'trauma', label: '外伤' },
                                { value: 'wear', label: '磨损' },
                                { value: 'erosion', label: '酸蚀' },
                                { value: 'other', label: '其他' }
                            ]
                        },
                        {
                            id: 'defect_details',
                            field: 'defect_details',
                            text: '缺损详细情况',
                            type: 'textarea',
                            placeholder: '请记录缺损牙位、部位、范围等详细信息',
                            dependsOn: 'defect_present',
                            showWhen: ['yes'],
                            rows: 3
                        }
                    ]
                },
                {
                    id: 'tooth_missing_check',
                    type: 'composite',
                    label: '牙齿缺失检查',
                    description: '检查牙齿缺失情况',
                    required: true,
                    subQuestions: [
                        {
                            id: 'missing_present',
                            field: 'missing_present',
                            text: '是否有牙齿缺失',
                            type: 'radio',
                            options: [
                                { value: 'no', label: '无缺失' },
                                { value: 'yes', label: '有缺失' }
                            ]
                        },
                        {
                            id: 'missing_positions',
                            field: 'missing_positions',
                            text: '缺失牙位',
                            type: 'textarea',
                            placeholder: '请详细记录缺失牙位（如：上颌右侧第一磨牙、下颌双侧第一前磨牙等）',
                            dependsOn: 'missing_present',
                            showWhen: ['yes'],
                            rows: 3
                        },
                        {
                            id: 'missing_duration',
                            field: 'missing_duration',
                            text: '缺失时间',
                            type: 'select',
                            dependsOn: 'missing_present',
                            showWhen: ['yes'],
                            options: [
                                { value: 'recent', label: '近期（1个月内）' },
                                { value: 'short', label: '短期（1-6个月）' },
                                { value: 'medium', label: '中期（6个月-2年）' },
                                { value: 'long', label: '长期（2年以上）' },
                                { value: 'unknown', label: '不详' }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            id: 'periodontal_condition',
            title: '牙周情况',
            description: '检查牙龈健康状况、牙周袋深度、牙槽骨吸收等',
            questions: [
                {
                    id: 'gingival_health',
                    type: 'composite',
                    label: '牙龈健康检查',
                    description: '检查牙龈的颜色、质地、出血情况',
                    required: true,
                    subQuestions: [
                        {
                            id: 'gingival_color',
                            field: 'gingival_color',
                            text: '牙龈颜色',
                            type: 'radio',
                            options: [
                                { value: 'normal', label: '正常（粉红色）' },
                                { value: 'red', label: '红色' },
                                { value: 'dark_red', label: '暗红色' },
                                { value: 'pale', label: '苍白' },
                                { value: 'cyanotic', label: '紫绀' }
                            ]
                        },
                        {
                            id: 'gingival_texture',
                            field: 'gingival_texture',
                            text: '牙龈质地',
                            type: 'radio',
                            options: [
                                { value: 'normal', label: '正常（坚韧有弹性）' },
                                { value: 'soft', label: '松软' },
                                { value: 'swollen', label: '肿胀' },
                                { value: 'hard', label: '坚硬' },
                                { value: 'fibrous', label: '纤维性增生' }
                            ]
                        },
                        {
                            id: 'gingival_bleeding',
                            field: 'gingival_bleeding',
                            text: '牙龈出血情况',
                            type: 'radio',
                            options: [
                                { value: 'none', label: '无出血' },
                                { value: 'probing', label: '探诊出血' },
                                { value: 'spontaneous', label: '自发性出血' },
                                { value: 'brushing', label: '刷牙出血' }
                            ]
                        },
                        {
                            id: 'gingival_abnormal_desc',
                            field: 'gingival_abnormal_desc',
                            text: '异常情况描述',
                            type: 'textarea',
                            placeholder: '如有异常情况，请详细描述位置和表现',
                            rows: 3
                        }
                    ]
                },
                {
                    id: 'periodontal_pocket',
                    type: 'composite',
                    label: '牙周袋深度检查',
                    description: '测量各牙位点的牙周袋深度',
                    required: true,
                    subQuestions: [
                        {
                            id: 'pocket_depth_normal',
                            field: 'pocket_depth_normal',
                            text: '牙周袋深度是否正常',
                            type: 'radio',
                            options: [
                                { value: 'normal', label: '正常（≤3mm）' },
                                { value: 'abnormal', label: '异常（>3mm）' }
                            ]
                        },
                        {
                            id: 'pocket_depth_details',
                            field: 'pocket_depth_details',
                            text: '异常牙周袋深度记录',
                            type: 'textarea',
                            placeholder: '请记录各牙位点的具体深度数值（如：上颌右侧第一磨牙近中5mm、远中4mm等）',
                            dependsOn: 'pocket_depth_normal',
                            showWhen: ['abnormal'],
                            rows: 4
                        },
                        {
                            id: 'pocket_depth_max',
                            field: 'pocket_depth_max',
                            text: '最大牙周袋深度',
                            type: 'number',
                            placeholder: '请输入最大深度值',
                            min: 0,
                            max: 20,
                            step: 0.5,
                            unit: 'mm',
                            dependsOn: 'pocket_depth_normal',
                            showWhen: ['abnormal']
                        }
                    ]
                },
                {
                    id: 'alveolar_bone',
                    type: 'composite',
                    label: '牙槽骨吸收检查',
                    description: '评估牙槽骨吸收程度',
                    required: true,
                    subQuestions: [
                        {
                            id: 'bone_resorption',
                            field: 'bone_resorption',
                            text: '牙槽骨吸收程度',
                            type: 'radio',
                            options: [
                                { value: 'none', label: '无吸收' },
                                { value: 'mild', label: '轻度吸收' },
                                { value: 'moderate', label: '中度吸收' },
                                { value: 'severe', label: '重度吸收' }
                            ]
                        },
                        {
                            id: 'bone_resorption_sites',
                            field: 'bone_resorption_sites',
                            text: '吸收部位',
                            type: 'textarea',
                            placeholder: '请详细记录牙槽骨吸收的具体部位',
                            dependsOn: 'bone_resorption',
                            showWhen: ['mild', 'moderate', 'severe'],
                            rows: 3
                        }
                    ]
                }
            ]
        },
        {
            id: 'oral_mucosa',
            title: '口腔黏膜',
            description: '检查口腔黏膜的异常情况',
            questions: [
                {
                    id: 'mucosa_abnormality',
                    type: 'composite',
                    label: '黏膜异常检查',
                    description: '检查是否存在溃疡、白斑、红斑、肿物等',
                    required: true,
                    subQuestions: [
                        {
                            id: 'mucosa_normal',
                            field: 'mucosa_normal',
                            text: '口腔黏膜是否正常',
                            type: 'radio',
                            options: [
                                { value: 'normal', label: '正常' },
                                { value: 'abnormal', label: '异常' }
                            ]
                        },
                        {
                            id: 'mucosa_lesion_type',
                            field: 'mucosa_lesion_type',
                            text: '异常病变类型',
                            type: 'checkbox',
                            dependsOn: 'mucosa_normal',
                            showWhen: ['abnormal'],
                            options: [
                                { value: 'ulcer', label: '溃疡' },
                                { value: 'leukoplakia', label: '白斑' },
                                { value: 'erythroplakia', label: '红斑' },
                                { value: 'mass', label: '肿物' },
                                { value: 'pigmentation', label: '色素沉着' },
                                { value: 'other', label: '其他' }
                            ]
                        },
                        {
                            id: 'mucosa_lesion_details',
                            field: 'mucosa_lesion_details',
                            text: '病变详细描述',
                            type: 'textarea',
                            placeholder: '请详细记录病变的位置、大小、形态、颜色等特征',
                            dependsOn: 'mucosa_normal',
                            showWhen: ['abnormal'],
                            rows: 4
                        }
                    ]
                }
            ]
        },
        {
            id: 'maxillofacial_surgery',
            title: '颌面外科检查',
            description: '检查面部对称性和颞下颌关节功能',
            questions: [
                {
                    id: 'facial_symmetry',
                    type: 'composite',
                    label: '面部对称性检查',
                    description: '评估面部是否对称',
                    required: true,
                    subQuestions: [
                        {
                            id: 'facial_symmetry_normal',
                            field: 'facial_symmetry_normal',
                            text: '面部对称性',
                            type: 'radio',
                            options: [
                                { value: 'normal', label: '正常对称' },
                                { value: 'asymmetric', label: '不对称' }
                            ]
                        },
                        {
                            id: 'asymmetry_description',
                            field: 'asymmetry_description',
                            text: '不对称情况描述',
                            type: 'textarea',
                            placeholder: '请描述面部不对称的具体表现和偏差情况',
                            dependsOn: 'facial_symmetry_normal',
                            showWhen: ['asymmetric'],
                            rows: 3
                        }
                    ]
                },
                {
                    id: 'tmj_function',
                    type: 'composite',
                    label: '颞下颌关节功能检查',
                    description: '检查关节弹响、疼痛、开口度等',
                    required: true,
                    subQuestions: [
                        {
                            id: 'tmj_clicking',
                            field: 'tmj_clicking',
                            text: '关节弹响',
                            type: 'radio',
                            options: [
                                { value: 'none', label: '无弹响' },
                                { value: 'mild', label: '轻微弹响' },
                                { value: 'moderate', label: '明显弹响' },
                                { value: 'severe', label: '严重弹响' }
                            ]
                        },
                        {
                            id: 'tmj_pain',
                            field: 'tmj_pain',
                            text: '关节疼痛',
                            type: 'radio',
                            options: [
                                { value: 'none', label: '无疼痛' },
                                { value: 'mild', label: '轻度疼痛' },
                                { value: 'moderate', label: '中度疼痛' },
                                { value: 'severe', label: '重度疼痛' }
                            ]
                        },
                        {
                            id: 'mouth_opening',
                            field: 'mouth_opening',
                            text: '最大开口度',
                            type: 'number',
                            placeholder: '请输入最大开口度',
                            min: 0,
                            max: 80,
                            step: 1,
                            unit: 'mm'
                        },
                        {
                            id: 'tmj_other_symptoms',
                            field: 'tmj_other_symptoms',
                            text: '其他异常表现',
                            type: 'textarea',
                            placeholder: '请记录其他异常表现（如关节锁结、偏斜等）',
                            rows: 3
                        }
                    ]
                }
            ]
        }
    ],

    // 治疗建议配置
    treatmentRecommendations: {
        caries: {
            shallow: ['补牙治疗', '氟化物应用', '口腔卫生指导'],
            medium: ['补牙治疗', '根管治疗（如需要）'],
            deep: ['根管治疗', '牙冠修复'],
            pulpitis: ['根管治疗', '消炎止痛'],
            periapical: ['根管治疗', '根尖手术（如需要）', '拔牙（严重病例）']
        },
        defect: {
            caries: ['树脂修复', '嵌体修复', '冠修复'],
            trauma: ['树脂修复', '冠修复', '根管治疗（如需要）'],
            wear: ['冠修复', '咬合调整', '夜磨牙垫'],
            erosion: ['脱敏治疗', '树脂修复', '饮食指导']
        },
        missing: {
            single: ['种植牙修复', '固定桥修复', '活动义齿'],
            multiple: ['活动义齿', '固定桥修复', '种植牙修复'],
            full: ['全口义齿', '种植覆盖义齿']
        },
        periodontal: {
            gingivitis: ['口腔卫生指导', '龈上洁治', '定期复查'],
            mild_periodontitis: ['龈上洁治', '龈下刮治', '根面平整'],
            moderate_periodontitis: ['牙周刮治', '根面平整', '牙周手术'],
            severe_periodontitis: ['牙周手术', '维护治疗', '拔牙（无保留价值）']
        },
        mucosa: {
            ulcer: ['观察', '药物治疗', '病因去除'],
            leukoplakia: ['活检', '病因去除', '定期随访'],
            mass: ['活检', '手术切除', '病理检查']
        },
        tmj: {
            dysfunction: ['理疗', '药物治疗', '咬合板治疗'],
            severe: ['手术干预', '关节镜治疗']
        }
    },

    // 界面文本配置
    ui: {
        buttons: {
            previous: '上一步',
            next: '下一步',
            submit: '生成检查报告',
            export: '导出结果',
            restart: '重新检查',
            backToHome: '返回首页',
            home: '返回首页',
            settings: '设置',
            save: '保存结果'
        },
        messages: {
            validationError: '请完成所有必填项目',
            submitSuccess: '检查报告生成成功！',
            submitError: '生成失败，请重试',
            exportSuccess: '结果导出成功！',
            exportError: '导出失败，请重试',
            saveSuccess: '检查结果保存成功！',
            saveError: '保存失败，请重试'
        },
        placeholders: {
            name: '请输入姓名',
            age: '请输入年龄',
            textarea: '请输入详细描述',
            number: '请输入数字'
        }
    },

    // 设置页面配置
    settings: {
        title: '设置',
        description: '口腔检查表设置选项'
    },

    // 导出设置
    export: {
        filename: '口腔检查结果',
        includeRecommendations: true,
        title: '导出结果'
    },

    // 结果显示配置
    result: {
        title: '口腔检查结果',
        summary: '检查总结',
        findings: '检查发现',
        recommendations: '治疗建议',
        followUp: '复查建议'
    }
};

export default oralConfig;
